from datetime import datetime
from typing import Optional
from pydantic import BaseModel

class AICharacterBase(BaseModel):
    name: str
    avatar: Optional[str] = None
    personality: Optional[str] = None
    background: Optional[str] = None
    is_public: bool = False

class AICharacterCreate(AICharacterBase):
    pass

class AICharacterUpdate(BaseModel):
    name: Optional[str] = None
    avatar: Optional[str] = None
    personality: Optional[str] = None
    background: Optional[str] = None
    is_public: Optional[bool] = None

class AICharacter(AICharacterBase):
    id: str
    creator_id: str
    created_at: datetime
    updated_at: datetime
    interaction_count: int = 0